<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>tree test 01</title>
    <link th:href="@{/css/zTreeStyle/zTreeStyle.css}" rel="stylesheet"/>
</head>

<body>
<ul id="treeDemo" class="ztree"></ul>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/jquery.ztree.all.min.js}"></script>
<SCRIPT type="text/javascript">
    <!--
    var setting = {
        data: {
            simpleData: {
                enable: true
            }
        }
    };

    $(document).ready(function(){

      $.ajax({
        cache: false,
        async: false,
        url: "/tree/getTree",
        type: "get",
        dataType: "json",
        success: function (data) {
          $.fn.zTree.init($("#treeDemo"), setting, data.data);
        }
      });

    });
    //-->
</SCRIPT>
</body>
</html>